﻿using System;
using System.Threading;
using System.Threading.Tasks;

namespace Fast.Extensions.DatabaseAccessor.EntityFrameworkCore
{
    /// <summary>
    /// 写仓储实现
    /// </summary>
    /// <typeparam name="TEntity"></typeparam>
    public partial class RootRepository<TEntity>
        where TEntity : class, IRootEntity, new()

    {
        public int SaveChanges()
        {
            return Context.SaveChanges();
        }

        public async Task<int> SaveChangesAsync(CancellationToken cancellationToken = default)
        {
            return await Context.SaveChangesAsync(cancellationToken);
        }
    }
}
